public class StudentMassage extends Student{
    public String classroom;
    int a =8;

    public StudentMassage(String name,int age,String classroom){
        super(name,age);//调用父类的构造方法,初始化父类的成员
        this.classroom = classroom;
        eat();//从父类中调用的
        System.out.println("年龄为"+super.age);
        System.out.println(this.a);//就近原则
        System.out.println(super.a);//访问父类
    }


    /**
     * 获取
     * @return classroom
     */
    public String getClassroom() {
        return classroom;
    }

    /**
     * 设置
     * @param classroom
     */
    public void setClassroom(String classroom) {
        this.classroom = classroom;
    }

    public void ClassRoom(){
        System.out.println(this.name+"是"+this.classroom+"的学生");
    }
}
